package com.shop.loan.model.vo;

import lombok.Getter;
import lombok.Setter;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.Readonly;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.ChoiceType;
import xyz.erupt.annotation.sub_field.sub_edit.VL;
import xyz.erupt.jpa.model.BaseModel;

import javax.persistence.Transient;
import java.math.BigDecimal;

@Erupt(name = "提现申请")
@Getter
@Setter
public class WithdrawApplyVo extends BaseModel {

    @Transient
    @EruptField(
            edit = @Edit(title = "余额信息", type = EditType.DIVIDE)
    )
    private String divide_base;

    @Transient
    @EruptField(
            views = @View(title = "资管余额"),
            edit = @Edit(title = "资管余额", readonly = @Readonly)
    )
    private BigDecimal assetBalance = BigDecimal.ZERO;


    @Transient
    @EruptField(
            views = @View(title = "融单余额"),
            edit = @Edit(title = "融单余额", readonly = @Readonly)
    )
    private BigDecimal rdBalance = BigDecimal.ZERO;


    @Transient
    @EruptField(
            edit = @Edit(title = "提现信息", type = EditType.DIVIDE)
    )
    private String divide_w;

    @EruptField(
            views = @View(title = "余额类型"),
            edit = @Edit(
                    title = "余额类型",
                    type = EditType.CHOICE,
                    notNull = true,
                    choiceType = @ChoiceType(
                            vl = {
                                    @VL(label = "资管", value = "2"),
                                    @VL(label = "融担", value = "3"),
                            }
                    ))
    )
    private Integer type;


    @Transient
    @EruptField(
            views = @View(title = "金额"),
            edit = @Edit(title = "金额", placeHolder = "为空则全部提现")
    )
    private BigDecimal number;

}
